<template>
  <div>
  <div v-if="Switch1">
         <el-aside key="1">
    <el-menu :default-active="this.$router.path" @select="selectMenu">
      <!-- <el-menu-item index="/userInfo"><i class="el-icon-s-comment"></i>个人信息</el-menu-item> -->
      <el-menu-item index="/user"><i class="el-icon-user-solid"></i>用户管理</el-menu-item>
      <el-submenu index="1">
        <template slot="title"><i class="el-icon-s-grid"></i>系统管理</template>
        <el-menu-item-group>
          <!-- <el-menu-item index="user"><i class="el-icon-shopping-cart-2"></i>购物车</el-menu-item> -->
          <el-menu-item index="/dish">菜单管理</el-menu-item>
          <el-menu-item index="/category">菜单分类管理</el-menu-item>
        </el-menu-item-group>
        <!-- <el-menu-item-group title="分组2">
          <el-menu-item index="1-3">选项3</el-menu-item>
        </el-menu-item-group> -->
        <!-- <el-submenu index="1-4">
          <template slot="title">选项4</template>
          <el-menu-item index="1-4-1">选项4-1</el-menu-item>
        </el-submenu> -->
      </el-submenu>
      <!-- <el-menu-item index="/weather"><i class="el-icon-s-data"></i>报表统计</el-menu-item> -->
    </el-menu>
  </el-aside>
  </div>
  <div v-if="Switch2">
    <el-aside key="2">
    <el-menu :default-active="this.$router.path" @select="selectMenu">
      <el-menu-item index="/userInfo"><i class="el-icon-s-comment"></i>个人信息</el-menu-item>
      <el-menu-item index="/userDish"><i class="el-icon-user-solid"></i>菜单</el-menu-item>
      <el-submenu index="1">
        <template slot="title"><i class="el-icon-s-grid"></i>系统管理</template>
        <el-menu-item-group>
          <!-- <el-menu-item index="user"><i class="el-icon-shopping-cart-2"></i>购物车</el-menu-item> -->
          <el-menu-item index="/shopCart">购物车</el-menu-item>
          <el-menu-item index="/order">订单管理</el-menu-item>
          <!-- <el-menu-item index="dish">菜单分类管理</el-menu-item> -->
        </el-menu-item-group>
        <!-- <el-menu-item-group title="分组2">
          <el-menu-item index="1-3">选项3</el-menu-item>
        </el-menu-item-group> -->
        <!-- <el-submenu index="1-4">
          <template slot="title">选项4</template>
          <el-menu-item index="1-4-1">选项4-1</el-menu-item>
        </el-submenu> -->
      </el-submenu>
      <!-- <el-menu-item index="/weather"><i class="el-icon-s-data"></i>报表统计</el-menu-item> -->
    </el-menu>
  </el-aside>
  </div>
</div>
</template>
<script>
export default {
  name: 'MyAside',
  computed: {
    testNum () {
      return sessionStorage.getItem('Authority')
    }
  },
  data () {
    return {
      Switch1: sessionStorage.getItem('Authority1'),
      Switch2: sessionStorage.getItem('Authority2')
    }
  },
  methods: {
    selectMenu (path) {
      if (this.$router.path !== path) {
        this.$router.push({
          path
        })
      }
    }
  }
}
</script>
<style scoped>
  .el-aside {
    /* position: relative; */
    height: 84.5vh;
    width: 40px;
    color: #333;
    border-right: 4px solid  gray;
    background-color: burlywood;
  }
  .el-menu{
    border-radius: 20px;
    box-shadow:3px 6px 10px 5px gray;
    opacity:0.8;
  }
</style>
